package cc.sunni.test;

/**
 * 类型推断
 *
 * @author jl
 * @since 2021/1/17 12:21
 */

@FunctionalInterface
interface IMath {
    int test(int x, int y);
}

public class TypeDemo {

    public static void main(String[] args) {
        // 变量类型定义
//        IMath iMath = (x, y) -> x + y;
//        // 数组里
//        IMath[] iMath1 ={(x, y) -> x + y};
//        System.out.println(iMath1[0].demo.test(1,2));

        TypeDemo typeDemo = new TypeDemo();
        typeDemo.foo((x, y) -> x + y);
    }

    public void foo(IMath iMath) {

    }
}
